package com.learn.mybatis.mapper

import com.learn.mybatis.entity.StudentEntity
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param
import org.apache.ibatis.annotations.Select

/**
 *
 * @author zhub
 * @create 2018/8/11 16:42
 * @email zhub1@elab-plus.com
 **/

@Mapper
interface StudentMapper {

    @Select("select * from student")
    fun getStudentList(): List<StudentEntity>

    @Insert("insert into student(name, age) values(#{name}, #{age})")
    fun insert(@Param("name") name: String, @Param("age") age: Int)

}